package com.golfwithfriends.model;

import java.util.ArrayList;
import java.util.List;

public class Parcour {

	private int nbHole;
	private int currentHole;
	private List<Player> players;	
	
	public Parcour(int nbHole) {
		super();
		this.nbHole = nbHole;
		this.currentHole = 1;
		this.players = new ArrayList<Player>();
	}


	public int getNbHole() {
		return nbHole;
	}


	public void setNbHole(int nbHole) {
		this.nbHole = nbHole;
	}


	public int getCurrentHole() {
		return currentHole;
	}


	public void setCurrentHole(int currentHole) {
		this.currentHole = currentHole;
	}
	
	public void addPlayer(Player p)
	{
		if (p != null)
			players.add(p);
	}
	
	public Player getPlayerAtIndex(int i)
	{
		if (i < players.size())
			return players.get(i);
		return null;
	}
	
	public int getNbPlayer()
	{
		return players.size();
	}
	
	public String getPlayerNameAtIndex(int i)
	{
		if (i >= 0 && i < players.size())
			return players.get(i).getNom();
		return "";
	}
}
